#ifndef EWHA_H
#define EWHA_H

#include <QtCore>

enum EStackMain
{
	eInitial, ePatientInfoInput, eWorkarea
};

enum EStackSmallWorkarea
{
	eEmpty, eCapturedateList, eWindowingTool, eDrawTool, eGammaTool, eHistogramTool, eProfileTool
};

enum EStackLargeWorkarea
{
	ePatientList, eViewImage, eConfigCapture, ePreviewCapture
};

enum ESex
{
	eUnknown, eMale, eFemale
};

enum ETool
{
	eToolNone, eToolPosition, eToolOval, eToolRect, eToolLine, eToolPen, eToolText, eToolZoom, eToolLength, eToolProfile, eToolReset
};

enum EColor
{
	eStGray, eStGreen, eStOrange, eStRed, eStBlue
};

const QString strDateFormat("yyyy-M-d");
const QString strDateTimeFormat("yyyy-M-d h:m:s");
const QString strCaptureTempDir("capture");
const QString strDBFilename("information");
const QString strINIFilename("setting.ini");
const QString strModeINIFilename("mode.ini");
const QString strCfgMode("mode");
const QString strCfgCalibration("calibration");
const QString strCfgHorizontal("horizontal");
const QString strCfgVertical("vertical");
const QString strCfgZoomRatio("zoom_ratio");
const QString strCfgFullScreen("fullscreen");
const QString strCfgDiagnosis("Diagnosis");
const QString strCfgDiagnosisExePath("Diagnosis_exe_path");
const QString strCfgSaveExt("save_ext");
const QString strCfgConsoleExePath("Console_exe_path");
const QString strCfgImageSavePath("image_save_path");
const QString strNormalImgPath("Mode_Normal/Dataseries");
const QString strBinningImgPath("Mode_Binning/Dataseries");
const QString strDiagnosisImgName("4image");

const int iBinningModeWidth(1500);

typedef struct _SPatient
{
	int m_iID;
	QString m_strChart;
	QString m_strName;
	int m_iSex;
	QDate m_dateBirth;
	QString m_strIDNumber;
	QString m_strPhone;
	QDateTime m_dateLastCapture;

	_SPatient()
	{
		m_iID = -1;
	}

	int calcAge() const
	{
		return qMax(QDate::currentDate()
					.addDays(-m_dateBirth.day())
					.addMonths(-m_dateBirth.month())
					.addYears(-m_dateBirth.year()).year(),
					0);
	}

	QString sexAge() const
	{
		return QString("%1/%2").arg(m_iSex == eMale ? "남" : "여")
				.arg(calcAge());
	}
} SPatient;

typedef struct _SCapturePerDate
{
	int m_iPatientID;
	QDate m_timeCapture;
	QList<int> m_listPosition;
} SCapturePerDate;

typedef struct _SCapture
{
	int m_iPatientID;
	int m_iPosition;
	QString m_strFilepath;
	QDateTime m_dtCapture;
} SCapture;

#endif // EWHA_H
